/*----------------------------------------\ | Use to keep a record of the text color of the current document. | |-------------------------------------------| |--------------------------------------------------------------------| |---------------------------| | Argument: the name of a color you want to write to the word | | document; | |-----------------------------| |---------------------------------------| | The current color to the text in the word document will be | | translated into a color integer and saved into a global variable | | named color_init; | \----------------------------------------*/ %MACRO colorint(color) ; /*--------------------------------------------\ | Copy Right: Duo Zhou; | | Created: 6-19-2001 8:51pm; | | Purpose: Set the color of the document; | \--------------------------------------------*/ %global color_int; %if (%sysfunc(rxmatch(%sysfunc(rxparse($a)),&color)) and (not %sysfunc(rxmatch(%sysfunc(rxparse($d)),&color)))) %then %do; %if (%quote(%upcase(&color))= AUTO) %then %let color_int=0; %else %if (%quote(%upcase(&color))= BLACK) %then %let color_int=1; %else %if (%quote(%upcase(&color)) = BLUE) %then %let color_int=2; %else %if (%quote(%upcase(&color)) = CYAN) %then %let color_int=3; %else %if (%quote(%upcase(&color)) = GREEN) %then %let color_int=4; %else %if (%quote(%upcase(&color)) = MAGENTA) %then %let color_int=5; %else %if (%quote(%upcase(&color))= RED) %then %let color_int=6; %else %if (%quote(%upcase(&color))= YELLOW) %then %let color_int=7; %else %if (%quote(%upcase(&color))= WHITE) %then %let color_int=8; %else %if (%index(%upcase(&color), D) and %index(%upcase(&color), K) and %index(%upcase(&color), BLUE)) %then %let color_int=9; %else %if (%index(%upcase(&color), D) and %index(%upcase(&color), K) and %index(%upcase(&color), CYAN)) %then %let color_int=10; %else %if (%index(%upcase(&color), D) and %index(%upcase(&color), K) and %index(%upcase(&color), GREEN)) %then %let color_int=11; %else %if (%index(%upcase(&color), D) and %index(%upcase(&color), K) and %index(%upcase(&color), MAGENTA)) %then %let color_int=12; %else %if (%index(%upcase(&color), D) and %index(%upcase(&color), K) and %index(%upcase(&color), RED)) %then %let color_int=13; %else %if (%index(%upcase(&color), D) and %index(%upcase(&color), K) and %index(%upcase(&color), YELLOW)) %then %let color_int=14; %else %if (%index(%upcase(&color), D) and %index(%upcase(&color), K) and %index(%upcase(&color), GRAY)) %then %let color_int=15; %else %if (%index(%upcase(&color), L) and %index(%upcase(&color), T) and %index(%upcase(&color), GRAY)) %then %let color_int=16; %else %let color_int=0; %end; %else %if (%sysfunc(rxmatch(%sysfunc(rxparse($d)),&color)) and (not %sysfunc(rxmatch(%sysfunc(rxparse($a)),&color)))) %then %do; %if (&color= 0) %then %let color_int=AUTO; %else %if (&color= 1) %then %let color_int=BLACK; %else %if (&color = 2) %then %let color_int=BLUE; %else %if (&color = 3) %then %let color_int=CYAN; %else %if (&color = 4) %then %let color_int=GREEN; %else %if (&color = 5) %then %let color_int=MAGENTA; %else %if (&color= 6) %then %let color_int=RED; %else %if (&color= 7) %then %let color_int=YELLOW; %else %if (&color= 8) %then %let color_int=WHITE; %else %if (&color=9) %then %let color_int=DARKBLUE; %else %if (&color=10) %then %let color_int=DARKCYAN; %else %if (&color=11)%then %let color_int=DARKGREEN; %else %if (&color=12)%then %let color_int=DARKMAGENTA; %else %if (&color=13) %then %let color_int=DARKRED; %else %if (&color=14) %then %let color_int=DARKYELLOW; %else %if (&color=15) %then %let color_int=DARKGRAY; %else %if (&color=16) %then %let color_int=LIGHTGRAY; %else %let color_int=AUTO; %end; &color_int %MEND colorint;